bitkeeper revision 1.1150 (41120577g9fFRK1fSLMW6p4QnOuLrQ)
authorgm281@boulderdash.cl.cam.ac.uk <gm281@boulderdash.cl.cam.ac.uk>
Thu, 5 Aug 2004 10:01:27 +0000 (10:01 +0000)
committergm281@boulderdash.cl.cam.ac.uk <gm281@boulderdash.cl.cam.ac.uk>
Thu, 5 Aug 2004 10:01:27 +0000 (10:01 +0000)
Overflows in the printing routine fixed.

xen/common/vsprintf.c

index fd304b9391ca9b5cf60a1b0d3df5fd185bb4f351..cfda9601d1500fac96cfd4cd8740486d0e80c67b 100644 (file)
@@ -123,7 +123,7 @@ static int skip_atoi(const char **s)
 #define SPECIAL        32              /* 0x */
 #define LARGE  64              /* use 'ABCDEF' instead of 'abcdef' */
 
-static char * number(char * buf, char * end, long num, int base, int size, int precision, int type)
+static char * number(char * buf, char * end, long long num, int base, int size, int precision, int type)
 {
     char c,sign,tmp[66];
     const char *digits;
@@ -163,7 +163,7 @@ static char * number(char * buf, char * end, long num, int base, int size, int p
     else 
     {
         /* XXX KAF: force unsigned mod and div. */
-        unsigned long num2=(unsigned long)num;
+        unsigned long long num2=(unsigned long long)num;
         unsigned int base2=(unsigned int)base;
         while (num2 != 0) { tmp[i++] = digits[num2%base2]; num2 /= base2; }
     }